<!DOCTYPE html>
<html>
    <head>
        <script src="vue.js"></script>
    </head>
    <body>
        <div id="app">

        </div>
        <template id="child1">
            <div>
            <button @click="click">Send</button>
            <input type="text" v-model="message">
        </div>
        </template>
        <script>
            Vue.component('parent',{
                template : '<div><child @childFn="transContent">子组件传来的值: {{message}}</child></div>',
                data : function() {
                    return { message : ''}
                },
                methods : {
                    tansContent(playload) {
                        this.message = playload;
                    }
                }
            })

            Vue.component('child',{
                template:'#child1',
                template:'',
                data : function() {
                   return{ message : '子组件的信息'}
                },
                methods : {
                    click() {
                        this.$emit('childFn',this.message);
                    }
                }
            });

            var vm = new Vue({
                el:'#app'
            });
           
        </script>
    </body>
</html>